OpenSSL: handle SSL_shutdown's errors properly
Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=
8ddffc6ba4f38bb8
Last-Update: 2020-08-19
Do not call SSL_shutdown on a session that is in handshake state (SSL_in_init(s)
returns 1). Also, do not call SSL_shutdown if a session encountered a fatal
error (SSL_ERROR_SYSCALL or SSL_ERROR_SSL was found before). If SSL_shutdown
was unsuccessful (returned code != 1), we have to clear the error(s) it queued.
Unfortunately, SSL_in_init was a macro in OpenSSL 1.0.x. We have to
resolve SSL_state to implement SSL_in_init.
Gbp-Pq: Name CVE-2020-13962.diff